package com.cskaoyan.controller;

import com.cskaoyan.bean.baseresultVO.BaseRespVo;
import com.cskaoyan.bean.stat.StatOfUser.StatOfUser;
import com.cskaoyan.service.StatService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author looper
 * @
 * 接受统计报表的请求
 **/
@RestController
@RequestMapping("admin/stat")
public class StatController {
    @Autowired
    StatService service;

    @GetMapping("user")
    public BaseRespVo getStatOfUser(){
        //返回一个类
      StatOfUser statOfUser =  service.getStatOfUser();

       return BaseRespVo.ok(statOfUser);

    }

    @GetMapping("order")
    public BaseRespVo getStatOfOrder(){
        //返回一个类
        StatOfUser statOfUser =  service.getStatOfOrder();

        return BaseRespVo.ok(statOfUser);

    }
    @GetMapping("goods")
    public BaseRespVo getStatOfGoods(){
        //返回一个类
        StatOfUser statOfGoods =  service.getStatOfGoods();

        return BaseRespVo.ok(statOfGoods);
    }


}
